YambHand = {
	name: "hand",
	yamb: null,
	
	isHand: true,
	
	init: function() {
		this.yamb.table.find("td[game_column="+this.name+"]").addClass("toplay");
	},
	
	onRollDice: function() {
		dices = this.yamb.getDices();
		this.isHand = dices.sum()==0 ? true : false;
		
		if(this.isHand) {
			this.yamb.table.find("td.field[game_column="+this.name+"]").each(function(){
				if(!$(this).hasClass("played")){
					$(this).addClass("toplay");
				}
			});
		}else{
			this.yamb.table.find("td.field[game_column="+this.name+"]").removeClass("toplay");
		}
	},
	
	play: function(td) {
		if(this.yamb.toPlay(td) && this.isHand) {
			var value = this.yamb.getGameValue(td.attr("game_row"));
			td.html(value);
			td.addClass("played").removeClass("toplay");
			
			return true;
		}
		return false;
	},
	
	undo: function(td) {
		td.addClass("toplay").removeClass("played");
	}
};